package com.geo.geotool.service.geofile.fileCharset;



import com.geo.geotool.entity.enmu.GeoFileTypeEnum;
import com.geo.geotool.util.file.FileUtils;

import java.io.File;

/**
 * • @Description: 文件编码格式捕获工厂
 * • @author  : yell
 * • @date : 2021/12/10  12:25
 */
public class GeoFileCharsetCaptureFactory {
    public static IFileCharsetCapture getFileCharsetCapture(String filePath){
        String suffix = FileUtils.getFileType(new File(filePath));
         if(suffix.equals(GeoFileTypeEnum.SHAPE.getType())){
            return new ShapeFileCharsetCapture();
        }else{
            return new ComFileCharsetCapture();
        }
    }
}
